$file1=$ARGV[0];
$file2=$ARGV[1];
$file3=$ARGV[2];
$file4=$ARGV[3];
$file5=$ARGV[4];
$file6=$ARGV[5];
$file7=$ARGV[6];
$file8=$ARGV[7];
$file9=$ARGV[8];
$file10 =$ARGV[9];
chomp($file1);
chomp($file2);
chomp($file3);
chomp($file4);
chomp($file5);
chomp($file6);
chomp($file7);
chomp($file8);
chomp($file9);
chomp($file10);
print "WHOLE : $file1\n";
print "MARKER : $file2\n";
print "0.0625MB : $file3\n";
print "0.125MB : $file4\n";
print "0.250MB: $file5\n";
print "0.5 MB: $file6\n";
print "1MB: $file7\n";
print "2MB: $file8\n";
print "4MB: $file9\n";
print "OUTPUT FILE : $file10\n";
open(WHOLE,$file1);
open(POS,$file2);
open(QUATERQUATER,$file3);
open(HALFQUATER,$file4);
open(QUATER,$file5);
open(HALF,$file6);
open(MB1,$file7);
open(MB2,$file8);
open(MB4,$file9);

open(WRBUFF,">$file10");
while($line = <WHOLE>)
{
	$line_pos = <POS>;
	chomp($line_pos);
	
	chomp($line);
	$line_quaterquater = <QUATERQUATER>;
	chomp($line_quaterquater);
	$line_halfquater = <HALFQUATER>;
	chomp($line_halfquater);
	$line_quater = <QUATER>;
	chomp($line_quater);
	$line_half=<HALF>;
	chomp($line_half);
	$line_1mb = <MB1>;
	chomp($line_1mb);
	$line_2mb = <MB2>;
        chomp($line_2mb);	
	$line_4mb = <MB4>;
        chomp($line_4mb);
	@array_pos = split(/\s/,$line_pos);
	@array_whole = split(/\t/,$line);
	@array_quaterquater = split(/\t/,$line_quaterquater);
	@array_halfquater = split(/\t/,$line_halfquater);
	@array_quater = split(/\t/,$line_quater);
	@array_half=split(/\t/,$line_half);
	@array_1mb = split(/\t/,$line_1mb);
	@array_2mb = split(/\t/,$line_2mb);
	@array_4mb = split(/\t/,$line_4mb);
	print WRBUFF "$array_whole[0]\t$array_pos[1]\t$array_whole[1]\t$array_quaterquater[1]\t$array_halfquater[1]\t$array_quater[1]\t$array_half[1]\t$array_1mb[1]\t$array_2mb[1]\t$array_4mb[1]\n";
	
}
